from importlib.metadata import files

from config import HOST


class ApiApproveTrust:
    def __init__(self,session):
        #初始化
        #获取session
        self.session = session
        #获取认证接口的url
        self._url_approve = HOST+"/member/realname/approverealname"
        #获取查询认证的url
        self._url_approve_status = HOST+"/member/member/getapprove"
        #获取开户的url
        self._url_trust = HOST+"/trust/trust/register"
        pass
    #认证接口封装
    def api_approve(self,realname,card_id):
        #请求数据
        data={
        "realname":realname,
        "card_id":card_id
        }
        #调用方法 难点 请求头要multipart-form/data    -> data +/files
        return self.session.post(self._url_approve,data=data,files = {"x":"y"})
    #查询接口封装
    def api_approve_status(self):
        return self.session.post(self._url_approve_status)
    #开户接口封装
    def api_trust(self):
        return self.session.post(self._url_trust)
